{% extends 'orgs/org-detail-base.html' %}
{% load static %}
{% block title %}
    机构课程列表页
{% endblock %}

{% block breach %}
    机构课程列表页
{% endblock %}
{% block right %}
    <div class="right companycenter layout">
        <div class="head">
            <h1>机构课程</h1>
        </div>
        <div class="brief group_list">
            <div class="brief group_list">
                {% for course in pages %}
                    <div class="module1_5 box">
                        <a href="{% url 'courses:course_detail' course.id %}"><img width="214" src="{{ MEDIA_URL }}{{ course.image }}"/></a>
                        <div class="des">
                            <a href="{% url 'courses:course_detail' course.id %}"><h2>{{ course.name }}</h2></a>
                            <span class="fl">课时：<i class="key">{{ course.add_time|date:"Y-m-g" }}</i></span>
                            <span class="fr">参加人数：{{ course.study_num }}</span>
                        </div>
                        <div class="bottom">
                            <span class="fl">{{ org.name }}</span>
                            <span class="star fr  notlogin
                            " data-favid="13" data-fav-type="4">
                            {{ course.love_num }}
                        </span>
                        </div>
                    </div>
                {% endfor %}
            </div>
        </div>


    </div>
    <div class="pageturn">
        <ul class="pagelist">
            {#                       has_previous是上一页 #}
            {% if pages.has_previous %}
                <li class="long"><a
                        href="?pagenum={{ pages.previous_page_number }}">上一页</a>
                </li>
            {% endif %}
            {#                        pa.num_pages是页面总数   pa.page_range是页码列表[1,2,3,4]之类的   .paginator所关联的Paginator对象#}
            {% for num in pages.paginator.page_range %}
                <li {% if num == pagenum %}class="active"{% endif %}><a href="?pagenum={{ pagenum }}">{{ pagenum }}</a>
                </li>
            {% endfor %}
            {#                       has_next是下一页 #}
            {% if pages.has_next %}
                <li class="long"><a
                        href="?pagenum={{ pages.next_page_number }}">下一页</a>
                </li>
            {% endif %}

        </ul>
    </div>

    </div>

{% endblock %}
